package com.shuai.frame.factory;

import com.shuai.frame.registry.RegistryCenter;
import com.shuai.frame.spi.XSRpcSPILoader;

public class RegistryFactory {
    static {
        XSRpcSPILoader.loadSPIImpl();
    }

    public static RegistryCenter getRegistryCenter(String registryCenterKey) {
        try {
            return XSRpcSPILoader.getInstance(RegistryCenter.class, registryCenterKey);
        } catch (InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
